<?php  
header("content-type:text/html;charset=utf-8");
?> 
<!doctype html>
<html lang="zh-cn">
<head>
  <meta charset="UTF-8">  
  <title>视频列表</title>
</head>
<body>

 <center><h3>视频列表</h3></center>
 <table align="center" width="80%" border=1> 
   <tr>
    <th>序号</th>
    <th>视频名称</th>
    <th>视频类型</th>
    <th>视频简介</th>
    <th>添加时间</th>
    <th>海报</th>
    <th>下载地址</th>    
    <th>操作 <a href="index.php?c=video&m=videoform">添加</a></th>
  </tr>                               

  <?php 
  foreach ($data['vv'] as $row) 
  {
   echo '<tr>';
   echo '<td>'.$row['vid'].'</td>';
   echo '<td>'.$row['videoname'].'</td>';
   switch($row['tid']){
     case '1':$dg = "电视剧";break;
     case '2':$dg = "动画片";break;
     case '3':$dg = "悬疑";break;
     case '4':$dg = "喜剧";break;
     case '5':$dg = "电影";break;     
     default: $dg="无";
   }

   echo '<td>'.$dg.'</td>';
   echo '<td>'.($row['intro']).'</td>'; 
   echo '<td>'.($row['uploaddate']).'</td>'; 
   echo '<td align="center"><img src="upload/'.$row['pic'].'" width=60 height=80 alt="无海报"></td>'; 
   echo '<td>'.($row['address']).'</td>';     
   echo'<td><a href="index.php?c=video&m=videomod&id='.$row['vid'].' ">修改</a>|<a href="index.php?c=video&m=delvideo&id='.$row['vid'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
   echo'</tr>';
 }

 $totalrows = count($data['vv']);
 echo "<table align='center'><tr><td>共有{$totalrows}部视频</td></tr></table>";   
 ?>
 
</body>
</html>